<template>
  <el-table :data="props.tableData" class="zs-tabel-page-main-no-footer" :stripe="true">
    <el-table-column type="index" label="序号" width="60" :align="'center'" />
    <el-table-column prop="projectName" label="项目" :align="'left'" width="260" />
    <el-table-column prop="bizType" label="业态" :align="'center'" width="100" >
      <template #default="scope">
        {{ getDictLabel(dictObj['PROJECT_COMMERCIAL_ACTIVITIES'], scope.row.bizType) }}
      </template>
    </el-table-column>
    <el-table-column prop="phase" label="阶段" :align="'center'" width="120" >
      <template #default="scope">
        {{ getDictLabel(dictObj['PROJECT_STAGE'], scope.row.phase) }}
      </template>
    </el-table-column>
    <el-table-column label="集团" :align="'center'" width="100" >
      <template #default="scope">
        {{ getDictLabel(dictObj['INVESTOR'], scope.row.investor) }}
      </template>
    </el-table-column>
    <el-table-column prop="city" label="城市" :align="'center'" width="100" >
      <template #default="scope">
        {{ getCityLabel(scope.row.city) }}
      </template>
    </el-table-column>
    <el-table-column label="销售" :align="'right'">
      <template #default="scope">
        {{ toThousands(scope.row.saleDay) }}
      </template>
    </el-table-column>
    <el-table-column label="当月累计" :align="'right'">
      <template #default="scope">
        {{ toThousands(scope.row.flowDay) }}
      </template>
    </el-table-column>
    <el-table-column label="当月达成" :align="'right'">
      <template #default="scope">
        {{ scope.row.rentalRate }}%
      </template>
    </el-table-column>
    <el-table-column label="操作" width="150" :align="'right'">
      <template #default="scope">
        <el-button class="zs-link" link size="small" @click="goPage(scope.row)">查看</el-button>
      </template>
    </el-table-column>
  </el-table>
  <div class="zs-text-gray-dark zs-text-sm zs-space-top">*销售：万元</div>
</template>

<script setup>
import { toThousands } from '@/utils/number-util'
import { getDictLabel, getCityLabel } from '@/utils/dbUtil'
import { useStore } from 'vuex'
import { useRouter } from 'vue-router'
const router = useRouter()
let store = useStore()
const dictObj = store.getters.getDictObj(["INVESTOR", "PROJECT_STAGE", "PROJECT_COMMERCIAL_ACTIVITIES"]);

const props = defineProps({
  updateDate: {
    type: String,
    required: false,
  },
  tabPermi: {
    type: String,
    required: false,
  },
  tableData: {
    type: Array,
    required: false,
  },
  pageSize: {
    type: Number,
    required: false,
  },
  pageNumber: {
    type: Number,
    required: false,
  }
})

const goPage = (row) => {
  router.push({
    path: '/page/routeController/index',
    query: {
      rid: 'page_901_lianyinglianying_xiangqing',
      rTitle: '联营项目详情',
      projectZylyCode: row.projectZylyCode,
      templateCode: row.templateCode,
      updateDate: props.updateDate,
      tabPermi: props.tabPermi,
    },
  })
}

</script>

<style scoped lang="scss"></style>
